/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaces;

import dao.LocaisVisitadosDAO;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import modelo.LocaisVisitados;

/**
 *
 * @author marcieli
 */
public class FrameLocaisVisitadoGerencia extends javax.swing.JInternalFrame {

    List<LocaisVisitados> lista = new ArrayList<LocaisVisitados>();
    Integer contCodigo = 0;
    Integer posicaolista;

    public FrameLocaisVisitadoGerencia() {
        initComponents();

        lista = lvi.Listar();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        txtLocal = new javax.swing.JTextField();
        txtAtendente = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        txtCod = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        ButInserir = new javax.swing.JButton();
        ButAtualizar = new javax.swing.JButton();
        ButNovo = new javax.swing.JButton();
        ButRemover = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        ButPrimeiro = new javax.swing.JButton();
        ButAnterior = new javax.swing.JButton();
        ButProximo = new javax.swing.JButton();
        ButUltimo = new javax.swing.JButton();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setTitle("Gerenciar locais visitados");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dados", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14), java.awt.Color.darkGray)); // NOI18N

        jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel6.setText("Imagem");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(89, 89, 89)
                .addComponent(jLabel6)
                .addContainerGap(113, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(55, 55, 55)
                .addComponent(jLabel6)
                .addContainerGap(59, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel7.setText("Imagem");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(65, 65, 65)
                .addComponent(jLabel7)
                .addContainerGap(137, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(61, Short.MAX_VALUE)
                .addComponent(jLabel7)
                .addGap(54, 54, 54))
        );

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel2.setText("Local:");

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel5.setText("Atendente:");

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel8.setText("Código:");

        txtCod.setEditable(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtLocal))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(0, 16, Short.MAX_VALUE))
                                    .addComponent(txtAtendente))))
                        .addGap(52, 52, 52))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtCod, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(63, 63, 63))))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(txtCod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(24, 24, 24)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtLocal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addGap(14, 14, 14)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(txtAtendente))
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Opções"));

        ButInserir.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButInserir.setText("Inserir");
        ButInserir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButInserirActionPerformed(evt);
            }
        });

        ButAtualizar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButAtualizar.setText("Atualizar");
        ButAtualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButAtualizarActionPerformed(evt);
            }
        });

        ButNovo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButNovo.setText("Novo");
        ButNovo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButNovoActionPerformed(evt);
            }
        });

        ButRemover.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButRemover.setText("Excluir");
        ButRemover.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButRemoverActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(ButInserir, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(ButAtualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(ButNovo, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(ButRemover, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ButInserir)
                    .addComponent(ButAtualizar)
                    .addComponent(ButNovo)
                    .addComponent(ButRemover))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Navegação"));

        ButPrimeiro.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButPrimeiro.setText("Primeiro");
        ButPrimeiro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButPrimeiroActionPerformed(evt);
            }
        });

        ButAnterior.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButAnterior.setText("Anterior");
        ButAnterior.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButAnteriorActionPerformed(evt);
            }
        });

        ButProximo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButProximo.setText("Proximo");
        ButProximo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButProximoActionPerformed(evt);
            }
        });

        ButUltimo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        ButUltimo.setText("Ultimo");
        ButUltimo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButUltimoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(ButPrimeiro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(ButAnterior, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(ButProximo, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
                    .addComponent(ButUltimo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(ButPrimeiro)
                .addGap(18, 18, 18)
                .addComponent(ButAnterior)
                .addGap(18, 18, 18)
                .addComponent(ButProximo)
                .addGap(18, 18, 18)
                .addComponent(ButUltimo)
                .addContainerGap(22, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 581, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createSequentialGroup()
                            .addGap(33, 33, 33)
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(25, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 539, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(78, 78, 78)
                            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(18, 18, 18)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ButInserirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButInserirActionPerformed
        if (txtLocal.getText().equals("") || txtAtendente.getText().equals("")) {
            JOptionPane.showMessageDialog(null, "Todos os campos são obrigatórios");

        } else {
            lvi.Cadastrar(CarregaDados());
            JOptionPane.showMessageDialog(null, "Cidade inserida com sucesso");
            LimparDados();
            lista = lvi.Listar();

        }

    }//GEN-LAST:event_ButInserirActionPerformed

    private void ButAtualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButAtualizarActionPerformed
//        if (txtLocal.getText().equals("") || txtAtendente.getText().equals("")) {
//            JOptionPane.showMessageDialog(null, "Todos os campos são obrigatórios");
//        } else {
//
//            Integer codigo = Integer.parseInt(txtCod.getText());
//            for (LocaisVisitados l : lista) {
//                if (codigo == l.getCodigo()) {
//                    l.setNomeLocal(txtLocal.getText());
//                    l.setAtendente(txtAtendente.getText());
//                    break;
//                }
//            }
//            JOptionPane.showMessageDialog(null, "Local atualizado com sucesso");
//            LimparDados();

//        }
    }//GEN-LAST:event_ButAtualizarActionPerformed

    private void ButNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButNovoActionPerformed
        LimparDados();
    }//GEN-LAST:event_ButNovoActionPerformed

    private void ButPrimeiroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButPrimeiroActionPerformed

        LocaisVisitados l = lista.get(0);

        txtCod.setText(l.getCodigo().toString());
        txtLocal.setText(l.getNomeLocal());
        txtAtendente.setText(l.getAtendente());

        posicaolista = 0;
    }//GEN-LAST:event_ButPrimeiroActionPerformed

    private void ButAnteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButAnteriorActionPerformed
        if (posicaolista > 0) {
            posicaolista = posicaolista - 1;
            LocaisVisitados l = lista.get(posicaolista);

            txtCod.setText(l.getCodigo().toString());
            txtLocal.setText(l.getNomeLocal());
            txtAtendente.setText(l.getAtendente());

            posicaolista = lista.size() - 1;
        }
    }//GEN-LAST:event_ButAnteriorActionPerformed

    private void ButProximoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButProximoActionPerformed

        if (posicaolista < (lista.size() - 1)) {
            posicaolista = posicaolista + 1;
            LocaisVisitados l = lista.get(posicaolista);

            txtCod.setText(l.getCodigo().toString());
            txtLocal.setText(l.getNomeLocal());
            txtAtendente.setText(l.getAtendente());
            posicaolista = lista.size() - 1;
        }
    }//GEN-LAST:event_ButProximoActionPerformed

    private void ButUltimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButUltimoActionPerformed
        LocaisVisitados l = lista.get((lista.size() - 1));
        txtCod.setText(l.getCodigo().toString());
        txtLocal.setText(l.getNomeLocal());
        txtAtendente.setText(l.getAtendente());

        posicaolista = lista.size() - 1;
    }//GEN-LAST:event_ButUltimoActionPerformed

    private void ButRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButRemoverActionPerformed
        int confirma = JOptionPane.showConfirmDialog(null, "Deseja excluir?");
        if (confirma == 0) {
            lv.setCodigo(Integer.parseInt(txtCod.getText()));
            lvi.Excluir(lv);
            LimparDados();
            lista = lvi.Listar();
        }
    }//GEN-LAST:event_ButRemoverActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton ButAnterior;
    private javax.swing.JButton ButAtualizar;
    private javax.swing.JButton ButInserir;
    private javax.swing.JButton ButNovo;
    private javax.swing.JButton ButPrimeiro;
    private javax.swing.JButton ButProximo;
    private javax.swing.JButton ButRemover;
    private javax.swing.JButton ButUltimo;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JTextField txtAtendente;
    private javax.swing.JTextField txtCod;
    private javax.swing.JTextField txtLocal;
    // End of variables declaration//GEN-END:variables
LocaisVisitadosDAO lvi = new LocaisVisitadosDAO();
    LocaisVisitados lv = new LocaisVisitados();

    public LocaisVisitados CarregaDados() {

        lv.setNomeLocal(txtLocal.getText());
        lv.setAtendente(txtAtendente.getText());

        return lv;

    }

    public void LimparDados() {
        txtCod.setText(null);
        txtLocal.setText(null);
        txtAtendente.setText(null);
    }
}
